package com.home.duy.code.components;

import java.awt.Graphics;
import java.awt.Image;
import java.io.IOException;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.JDesktopPane;
import javax.swing.JLabel;

public class DesktopPane extends JDesktopPane{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Image img;
	public DesktopPane(String path)
	{
		ClassLoader loader = Thread.currentThread().getContextClassLoader();
		URL url = loader.getResource(path);
		try {
			
			img = ImageIO.read(url);
		} catch (IOException e) {
			e.printStackTrace();
		}
		//this.add(new TestPanel());
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.drawImage(img,0,0,this);
	}
	
}
